package com.hnevc.yourhealthmanager.dto;

public class ResponseResult {
    private int code;
    private boolean success;
    private Object data;

    public ResponseResult(int code, boolean success, Object data) {
        this.code = code;
        this.success = success;
        this.data = data;
    }

    // 省略getter和setter方法
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    // 可以添加一些静态工厂方法来方便创建ResponseResult对象
    public static ResponseResult success(Object data) {
        return new ResponseResult(200, true, data);
    }

    public static ResponseResult error(int code, String message) {
        return new ResponseResult(code, false, message);
    }
}
